home *** CD-ROM | disk | FTP | other *** search
- #include "C:\DPN\DPN.HPP"
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <conio.h>
-
-
- int main(void)
- {
- Task *Job[10];
- int i;
- int AllDone;
- char FileName[255];
-
- DPN_Initialise();
- for (i=0;i<10;i++) {
- Job[i]=new Task(strcat(strcpy(FileName,getenv("NETDRIVE")),"\\NOTHING.EXE"),"");
- printf("Spooled task #%d\n",i);
- }
- printf("Press ENTER to commence killing the tasks ");
- getche();
- printf("\n\n");
- for (i=0;i<10;i++) {
- if (Job[i]->Kill())
- printf("Cannot kill task #%d : %s\n",i,DPN_ErrorMsg(Job[i]->ErrorCode(),FileName));
- else
- printf("Task #%d successfully killed\n",i);
- }
- do {
- DPN_Pause();
- AllDone=1;
- for (i=0;i<10;i++)
- if (!Job[i]->Finished())
- AllDone=0;
- printf("%d tasks still pending\n",DPN_Pending());
- } while (!AllDone);
- for (i=0;i<10;i++)
- printf("Task #%d : ExitCode=%d, %s\n",i,Job[i]->ExitCode(),DPN_ErrorMsg(Job[i]->ErrorCode(),FileName));
- }
-